<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>table定位</title>
    <style type="text/css">
        *{
            margin: 0px;
            padding: 0px;
        }
        html,body{
            width: 100%;
            height: 100%;
        }
        .wrap{
            display: table;
            width: 100%;
            height: 100%;
        }
        .conent{
            display: table-cell;
            /*垂直居中，其父元素需要有宽度与高度值*/
            vertical-align: middle;
        }
        .inner{
            width: 400px;
            height: 200px;
            background-color: #cccccc;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <div class="conent">
            <div class="inner">

            </div>
        </div>
    </div>
</body>
</html>